# admin

from django.contrib import admin
from django import forms

from app.models import *

from django import template
from django.contrib.admin.util import unquote
from django.utils.encoding import force_unicode
from django.utils.html import escape
from django.http import Http404
from django.core.exceptions import PermissionDenied

#register = template.Library()


class CityAdmin(admin.ModelAdmin):
    list_display = ('name',)
    ordering = ('name',)
    search_fields = ('name',)

        
class AddressAdmin(admin.ModelAdmin):
    list_display = ('street', 'number', 'city', 'zip_code')
    list_filter = ('city',)
    ordering = ('street', 'city')
    search_fields = ('street', 'city')
    

class CompanyAdmin(admin.ModelAdmin):
    list_display = ('name', 'address')
    list_filter = ('address',)
    ordering = ('name',)
    search_fields = ('name',)


admin.site.register(City, CityAdmin)
admin.site.register(Address, AddressAdmin)
admin.site.register(Company, CompanyAdmin)
